// written by Adam Barrer and Alex Keybl

#include "appt.h"

Appt::Appt(){
	
}

Appt::Appt(int day, double start, double end, const string& description) 
// For some reason this initializer list will not compile, so it is
// commented out for the time being.  It will be fixed for the final submission.
// :myDate(day), myStart(start), myEnd(end), myDescription(description)
{
  	myDate=day;
  	myStart=start;
  	myEnd=end;
  	myDescription=description;
  	
	unsigned int i=0;
	int sum=0;
	while(i<description.size()-1) {
		sum+=((int)description[i+1]%2+1)*(int)description[i]+((int)description[i]%2+2)*(int)description[i+1];
		i+=2;
	}
	
	myHash=sum;
}
// not needed at this point, nothing to change
/*int Appt::getDay(){
	return myDate;	
}	
		
int Appt::getStart(){
	return myStart;
}	
		
int Appt::getEnd(){
	return myEnd;
}	
		
string Appt::getDescription(){
	return myDescription;
}*/	

